﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects.DataClasses;

[assembly: global::System.Data.Objects.DataClasses.EdmSchemaAttribute()]
namespace WA.Core.DomainModel
{
    [EdmEntityType(Name = "Company", NamespaceName = "WA.Core.DomainModel")]
    public class Company : BaseEntity<int>
    {
        private string name;
        private string address;
        private string phone;
        private string taxIdentificationNumber;
        private string identificationNumber;
        private string city;

        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = false)]
        public int CompanyID
        {
            get
            {
                return base.ID;

            }
            set
            {
                this.PropertyChanging("CompanyID");
                base.ID = value;
                this.PropertyChanging("CompanyID");
            }
        }

        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable = false)]
        public string Name
        {
            get { return name; }
            set
            {
                this.PropertyChanging("Name");
                name = value;
                this.PropertyChanged("Name");
            }

        }

        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable = false)]
        public string Address
        {
            get { return address; }
            set
            {
                this.PropertyChanging("Address");
                address = value;
                this.PropertyChanged("Address");
            }

        }

        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable = false)]
        public string Phone
        {
            get { return phone; }
            set
            {
                this.PropertyChanging("Phone");
                phone = value;
                this.PropertyChanged("Phone");
            }

        }

        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable = false)]
        public string TaxIdentificationNumber
        {
            get { return taxIdentificationNumber; }
            set
            {
                this.PropertyChanging("TaxIdentificationNumber");
                taxIdentificationNumber = value;
                this.PropertyChanged("TaxIdentificationNumber");
            }

        }

        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable = false)]
        public string IdentificationNumber
        {
            get { return identificationNumber; }
            set
            {
                this.PropertyChanging("IdentificationNumber");
                identificationNumber = value;
                this.PropertyChanged("IdentificationNumber");
            }

        }


        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable = false)]
        public string City
        {
            get { return city; }
            set
            {
                this.PropertyChanging("City");
                city = value;
                this.PropertyChanged("City");
            }

        }

       public List<Invoice> Invoices
       {
            get
            {
                return this.Invoice.ToList();
            }           
       }

        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("WA.Core.DomainModel", "CompanyInvoice", "Invoice")]
        protected global::System.Data.Objects.DataClasses.EntityCollection<Invoice> Invoice
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Invoice>("WA.Core.DomainModel.CompanyInvoice", "Invoice");
            }
        }

        public List<Partner> Partners
        {
            get
            {
                return this.Partner.ToList();
            }
        }

        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("WA.Core.DomainModel", "CompanyPartner", "Partner")]
        protected global::System.Data.Objects.DataClasses.EntityCollection<Partner> Partner
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Partner>("WA.Core.DomainModel.CompanyPartner", "Parnter");
            }
        } 
      
    }
}
